package com.platform.server.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.platform.server.service.MessageService;

@Controller
@RequestMapping("/message")
public class MessageController {
	
	@Autowired
	private MessageService messageService;
	
	/**
	 * 通知消息列表
	 */
	@ResponseBody
	@RequestMapping(value = "/selectMessageList",method = RequestMethod.POST)
	public Object selectMessageList(String userid,Integer pageSize, Integer pageNo){
		if(pageSize==null||pageNo==null){
            pageNo =1;
            pageSize = 10;
        }
		return messageService.selectMessageList(userid,pageSize,pageNo);
	}
	
	/**
	 * 通知消息详情
	 */
	@ResponseBody
	@RequestMapping(value = "/selectMessageInfo",method = RequestMethod.POST)
	public Object selectMessageInfo(String messageid, String type){
		return messageService.selectMessageInfo(messageid,type);
	}
	
}
